<template>
  <div v-if="Object.keys(goods).length !==0" class="base-info">
    <div class="title"> {{ goods.title }}</div>
    <div class="info-price">
      <span class="n-price">{{ goods.newPrice }}</span>
      <span class="o-price">{{ goods.oldPrice }}</span>
      <span class="discount" v-if="goods.discount">{{ goods.discount }}</span>
    </div>
    <div class="show-info">
      <span>{{ goods.columns[0] }}</span>
      <span>{{ goods.columns[1] }}</span>
      <span>{{goods.services[goods.services.length-1].name}}</span>
    </div>
    <div class="info-service">
      <span class="info-service-item" v-for="index in goods.services.length - 1" :key="index">
        <img :src="goods.services[index - 1].icon" alt="">
        <span>{{ goods.services[index - 1].name }}</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name:"DetailBaseInfo",
  props:{
    goods:{
      type:Object,
      default(){
        return {}
      }
    }
  }
}
</script>

<style scoped>
  .base-info{
    margin-top: 15px;
    padding: 0 8px;
    color: #999;
    border-bottom: 5px solid #f2f5f8;
  }
  .title{
    padding-bottom: 5px;
    font-size: 15px;
    color: #222;
  }
  .n-price{
    font-size: 24px;
    color: hotpink;
  }
  .o-price{
    font-size: 13px;
    margin-left: 5px;
    text-decoration: line-through;
  }
  .discount{
    color: pink;
  }
  .info-service{
    display: flex;
    font-size: 12px;
    margin-bottom: 8px;
  }
  .info-service-item{
    flex: 1;
    color: #666;
  }
  .info-service-item img{
    font-size: 6px;
  }
  .show-info{
    display: flex;
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
    justify-content: space-between;
  }

  .info-service img{
    height: 10px;
  }
</style>